home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
M-More Monthly Disks
/
(c)m7.d64
/
joy 1c8.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
2KB
|
41 lines
0 REM********************************** * MACHINE LANGUAGE JOYSTICK *
1 REM* DECODER - COMMODORE 64 - 1C8 * * READS JOYSTICK #1 + FIREBUTTON *
2 REM* CONTINUOUS ACTION-8 DIRECTIONS * **********************************
3 REM********************************** * BY ROGER D BURGE, #2667 *
4 REM* TORONTO PET USERS GROUP INC. * * TORONTO, CANADA *
5 REM**********************************
10 POKE53280,1:POKE53281,6:PRINT"[147] MACHINE LANGUAGE DECODER ";
15 PRINT" #1C8 ";SPC(11)"READS 8 DIRECTIONS
20 [153][166] 12)"BY ROGER D BURGE":[153][166]12)"FOR JOYSTICK # 1":[153]"READS JOYSTICK ";
25 [153]"CONTINOUSLY, THAT IS, ONCE THE STICK IS PUSHED IN ONE DIRECTION ";
30 [153]"THE JOYSTICK DECODER ROUTINE WILL STILL GIVE THAT DIRECTION IF THE ";
35 [153]" STICK IS RELEASED.
40 PRINT"LINES 90 AND ON SHOULD BE INCLUDED IN YOUR PROGRAM."
45 PRINT"THE USE OF VARIABLES IN LINE 100 INSTEAD OF REAL NUMBERS, EG. 252,";
50 PRINT"GREATLYSPEEDS UP THE ROUTINE.
55 [153]"WHEN THE ROUTINE IS CALLED THEN D1 = THE DIRECTION GIVEN BY JOYSTICK ";
60 [153]"#1 AND FA = 1 IF THE FIRE BUTTON IS DOWN OR FA = 0 IF THE FIRE BUTTON IS ";
65 [153]"UP.":[153]"PRESS F1 TO TRY DECODER.":[153]"PRESS F3 TO LIST DECODER ROUTINE.
70 GETA$:IFA$="[133]"THENPRINT"[147]":GOTO90
75 IFA$="[134]"THENPRINT"[147]":LIST90-
80 GOTO70
90 GOSUB110:JS=820:F1=41:J1=251:B1=252
100 SYSJS:D1=F1-PEEK(J1):FA=PEEK(B1):PRINT"D1="D1"FA="FACHR$(13)"[145]":GOTO100
110 FORT=820TO914:READA:POKET,A:NEXT:RETURN
120 DATA173,1,220,41,15
130 DATA201,7,208,5,162,40,56,176,60
135 DATA201,5,208,5,162,0,56,176,51
140 DATA201,13,208,5,162,1,56,176,42
145 DATA201,9,208,5,162,2,56,176,33
150 DATA201,11,208,5,162,42,56,176,24
155 DATA201,10,208,5,162,82,56,176,15
160 DATA201,14,208,5,162,81,56,176,6
165 DATA201,6,208,2,162,80
170 DATA134,251
180 DATA173,1,220,41,16
190 DATA201,0,208,5,160,1,132,252,96
200 DATA160,0,132,252,96
210 REM**OMIT PRINT STATEMENTS IN LINE 100
220 REM*BEFORE GAME ACTION STARTS, POKE781,41:POKE 251,41
230 REM*THIS SUBROUTINE IS RELOCATABLE